<?php

 /**
  * @package JooS
  * @subpackage Syntax
  */

  require_once "JooS/Syntax/Abstract.php";

  abstract class JooS_Syntax_Simple extends JooS_Syntax_Abstract {
    /**
     * @var string
     */
    private $Chars = "";

    protected function setChars() {
      $this->initChars( $this->substr(1) );
    }

    /**
     * @param string $Chars
     */
    protected function initChars($Chars) {
      $this->Chars = $Chars;
    }

    /**
     * @return string
     */
    protected function getChars() {
      return $this->Chars;
    }

    /**
     * @return bool
     */
    protected function checkChars() {
      return $this->getChars() !== false;
    }
    
    public function shiftPos($mul = 1) {
      $this->substr( $mul * strlen($this->getChars()), true );
    }

    /**
     * @return string
     */
    public function compile() {
      $this->setChars();

      if ($this->checkChars()) {
        $this->shiftPos();
        return $this->getChars();
      }
      else
        return false;
    }
  }
